# 普通参数
# def say_hi(name):
#     print(f'hello {name}')
# say_hi('xiaoming')
#
# def create_window(width,height):
#     print(f"窗户的宽是{width}，高是{height}")
# create_window(1,2)

# 默认参数 如果该参数没传，则使用默认值
# def caculate_salary(hour,salary=8):
#     print(f"今天的薪水为：{hour*salary}")
#
# caculate_salary(8,20)

# 关键字参数
def student(firstname,lastname):
    print(f"firstname is {firstname},lastname is {lastname}")
student(firstname='jack',lastname='ma')
student(lastname='jack',firstname='ma')

# 不定长参数
## 使用一个* 的情况，此时args是一个元组
# def my_function(*args):
#     for arg in args:
#         print(arg)
# my_function("hello world","python is great")

# 使用两个* 此时args是一个字典
def my_function_02(**args):
    print(type(args))
    print(args)
    for k,v in args.items():
        print(f"{k}->{v}")

my_function_02(lastname='jack',firstname='ma')